﻿using sixgod.Enum;
using sixgod.Model.WorkFlowTemplate;
using SqlSugar;

namespace sixgod.Model.WorkFlow
{
    /// <summary>
    /// 实际流程
    /// </summary>
    [SugarTable("WorkFlowNode")]
    public class WorkFlowNode:ModelBase
    {
        /// <summary>
        /// 流程ID
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string WorkFlowId { get; set; }

        [Navigate(NavigateType.ManyToOne,nameof(WorkFlowId))]
        public WorkFlow WorkFlow { get; set; }

        /// <summary>
        /// 节点名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 流转时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? AuditTime { get; set; }

        /// <summary>
        /// 节点类型
        /// </summary>
        public EnumNodeType EnumNodeType { get; set; }

        /// <summary>
        /// 审核模式
        /// </summary>
        public EnumAuditMode EnumAuditMode { get; set; }

        /// <summary>
        /// 是否自动部门领导
        /// </summary>
        public bool AddDepartmentLeader { get; set; }

        /// <summary>
        /// 是否自动职位上级
        /// </summary>
        public bool AddJobLeader { get; set; }

        /// <summary>
        /// 提示方式，字典
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string? HintMethod { get; set; }

        /// <summary>
        /// 一人通过即通过的模式下是否抄送其他审核人
        /// </summary>
        public bool? SendOther{get;set; }

        /// <summary>
        /// 拒绝后的操作
        /// 1.回退  2.结束流程
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string? RejectOperation { get; set; }

        /// <summary>
        /// 模型数据验证
        /// </summary>
        /// <returns></returns>
        public override (bool, string) Verify()
        {
            return (false, null);
        }
    }
}